package com.gopay.common.mq.util;

import org.apache.activemq.command.ActiveMQDestination;

import javax.jms.Destination;

/**
 * Mq工具类
 */
public class MqUtils {

    public static Destination appendSuffix(Destination destination, String suffix){
        ActiveMQDestination activeMQDestination = (ActiveMQDestination) destination;

        if(activeMQDestination.getPhysicalName().endsWith(suffix)){
            return destination;
        }

        activeMQDestination.setPhysicalName(activeMQDestination.getPhysicalName() + "_" + suffix);
        return activeMQDestination;
    }
}
